@using VocaDb.Model.Domain
@using VocaDb.Web.Helpers
@using VocaDb.Model.Domain.Security
@using VocaDb.Web.Models.Song
@using VocaDb.Web.Code
@using VocaDb.Model.Utils
@using VocaDb.Model.Utils.Search
@inherits MenuPage

@helper BannerLink(string title, string url, string img) {
	<a href="@url" onclick="vdb.functions.trackOutboundLink(event)"><img src="@VocaUrlHelper.StaticResource("/banners/" + img)" alt="@title" title="@title" /></a>
}

@helper Banner(string title, string url, string img) {
    <li>@BannerLink(title, url, img)</li>
}

@helper SmallBanner(string title, string url, string img) {
    <div>@BannerLink(title, url, img)</div>
}

@helper SocialLink(string title, string url, string img ){
    @BannerLink(title, url, img)
}

<div class="span2 menu">
	<div class="well">
		<a href="@Url.Action("Index", "Home")">
			<img src="@(BannerUrl ?? VocaUrlHelper.StaticResource("/img/vocaDB-title.png"))" class="site-logo" alt="@BrandableStrings.Layout.SiteName" title="@BrandableStrings.Layout.SiteName" />
		</a>
		<p class="slogan">@VocaDb.Web.Code.SloganGenerator.Generate()</p>
	</div>

	<div class="well sidebar-nav">
		@{ Html.RenderPartial("Partials/_MainNavigationItems"); }
		@if (Login.Manager.IsLoggedIn) {
			<br />
			<p class="user">@ViewRes._LayoutStrings.Welcome @Html.ActionLink(Login.User.Name, "Profile", "User", new { id = Login.User.Name }, null)</p>
		}
	</div>			
		
	<div class="well">
		@if (AppLinks.Any()) {
			<div id="appLinks">
				@foreach (var link in AppLinks) {
					@SmallBanner(link.Title, link.Url, link.BannerImg)
				}
				<br />
			</div>
		}

		<h4>@ViewRes._LayoutStrings.SocialSites</h4>
		<div id="socialSites">
			@foreach (var link in SocialLinks) {
				@SocialLink(link.Title, link.Url, link.BannerImg)
			}
		</div>

		<br />
		<h4>@ViewRes._LayoutStrings.RelatedSites</h4>
		<ul id="banners">
			@foreach (var link in BigBanners) {
				@Banner(link.Title, link.Url, link.BannerImg)
			}
		</ul>					
		<div id="banners-small">
			@foreach (var link in SmallBanners) {
				@SmallBanner(link.Title, link.Url, link.BannerImg)
			}
		</div>
		@if (!string.IsNullOrEmpty(Config.SiteSettings.PatreonLink)) {
			<hr />
			Html.RenderPartial("Partials/_PatreonLink");
		}
		@if (!string.IsNullOrEmpty(Config.SiteSettings.PaypalDonateCert)) {
			<hr />
			Html.RenderPartial("Partials/_PaypalDonateButton");
		}
	</div>						
</div>
